package com.hmily.dubbo.provider.spi.ioc;

/**
 * <h1>通过debug调试拿到的 AnimalService$Adaptive 长什么样子。</h1>
 *
 * @author hmilyylimh
 * ^_^
 * @version 0.0.1
 * ^_^
 * @date 2021-11-14
 */

import org.apache.dubbo.common.extension.ExtensionLoader;

public class AnimalService$Adaptive implements com.hmily.dubbo.provider.spi.ioc.AnimalService {
    @Override
    public java.lang.String getWeight(org.apache.dubbo.common.URL arg0) {
        if (arg0 == null) throw new IllegalArgumentException("url == null");
        org.apache.dubbo.common.URL url = arg0;
        String extName = url.getParameter("animal");
        if (extName == null)
            throw new IllegalStateException("Failed to get extension (com.hmily.dubbo.provider.spi.ioc.AnimalService)" +
                    " name from url (" + url.toString() + ") use keys([animal])");
        com.hmily.dubbo.provider.spi.ioc.AnimalService extension =
                (AnimalService) ExtensionLoader.getExtensionLoader
                      (AnimalService.class).getExtension(extName);
        return extension.getWeight(arg0);
    }
}